Edit Declarations
Declarations are edited in the signal table or in the General section of the Declaration Editor .
Select multiple signals in the signal table to apply changes to them simultaneously.
Click Undo last operation or press Ctrl+Z to undo the last change.
Press ESC to cancel editing.
Signal type
A signal can be either a channel, a parameter, a constant, a measurement, or an assessment variable, see Signal Types. The signal type can be changed at any time.
Signal names must be unique and composed of alphanumeric characters (A-Z, a-z, 0-9). They can use underscores "_". They cannot start with a number and cannot contain whitespaces. The following items may not be used in or as names:
keywords |
|
mathematical |
All mathematical functions, see in TPT Modeling Language - Built-in Functions. Functions that can be used in the step list, see column "Step list", are not allowed as signal name. |
assessment |
All assessment keywords, see Test Assessment - Assessment Keywords. |
Signal names can be copied by right-clicking on a signal in the signal table and by selecting Copy Name, or press Ctrl+ ALT+C. Use this feature for copying struct elements or signals with namespaces. You can paste them elsewhere in the project, for example in a step list or assesslet with the shortcut Ctrl+V.
Signals can be renamed. Select a signal name in the signal table to change its name. Multiple selection is possible. Select Tools|Rename Selected Signals to open the Rename Signals dialog. The Java syntax for regular expressions is used. By default, the expressions (.+)
and $1
are set. In this way, for example, signals can be assigned to namespaces, see Figure " Rename signals to assigned them to namespaces, for example".
Data type
TPT comes with predefined data types, such as uint8
, int8
, int16
, uint32
, int32
, int64
, float
, double
, boolean
, string
. Click in the Data type field and press Ctrl+Space to select a predefined data type from the drop-down list. You can also enter data types manually.
Custom data types as well as the predefined ones can also be selected and edited in the Type Editor, see Type Editor. Click the threedots button ".." Open Type Editor button. For more information about data types, see Data Types.
In the signal table, click in the Data type column to select a predefined or reusable data type from the drop-down list. Click Define custom type to define a data type for the signal in the Type Editor.
Data types of sub-elements from single-use data types are indented. You can change the sub-elements of an array[]
, curve{}
, map{}
, matrix[][]
, and struct{}
in the Declaration Editor using the Data type drop-down list.
Data types of sub-elements from reusable data types can only be changed in the Type Editor. In the Declaration Editor, this is indicated by the gray color of the data type name of the sub-elements. For more information about reusable and single-use data types, see Type Editor.
Data types can be visually distinguished in the signal table.
Symbol | Data type |
---|---|
+ {} | struct |
²+{} | curve; a "2" is displayed as icon overlay that symbols the 2 dimensions of the curve |
³+{} | map; a "3" is displayed as icon overlay that symbols the 3 dimensions of the map |
The dimension of the data type can also be recognized by the symbol.
Symbol | Dimension |
---|---|
o | scalar (dimension = 0) |
[ ] | array (dimension = 1) |
[ ] [ ] | matrix (dimension = 2) |
[[..]] | dimension >= 3 |
For example, when you create an array-of-structs the icon used is [{}]
.
Group
For filter and search purposes, it is possible to add a name in the Group field. Use the same group name for several signals, to group signals.
Unit
This text field takes an optional arbitrary unit name. When importing signals from A2L-files, this information is extracted automatically. Units are displayed in step lists and can be used for calculations, see Units.
To add a unit, select a unit name from the Unit drop-down list. Units can be created and customized in the Unit Editor, see Unit Editor. TPT can automatically convert units used in the step list.
When loading old files that had units defined in structs, curves or maps, these units will be passed on just to those elements that are one level down, provided they are not structs, curves or maps and do not have their own unit (if any existing, it will be kept). If the type of a signal is set to struct, curve or map, an existing unit is deleted.
The Mode drop-down list is only available for channels and parameters. A channel mode can be IN, OUT, LOCAL, or NONE, see Signal Types - Channel. A parameter can be of the mode READONLY, WRITEONLY, LOCAL, or EXCHANGE, see Signal Types - Parameter.
This checkbox is applicable to channels, constants and assessment variables. If selected, the values of these signal types are logged during test execution no matter which execution platform is used. The checkbox is selected by default. Use this feature to reduce the size of the .tptbin
file.
Value
The value entered here, serves as the default value. To edit any declaration value, alternatively click the three dots button "..." located in the right lower corner of the dialog to open the Value Editor. For more information, see Value Editor.
Description
When you add a description to a signal, this description is visible in the report, the Signal Viewer, and the Debug Signal Viewer.
If you also add a comment to a signal via the Script assesslet, the comment of the Script assesslet prevails in the report; to comment a signal in the Script assesslet, type <signal>.setComment("add you comment here")
.